These low-level routines must be called by programs that have to deal
directly with the _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo database to handle certain terminal
capabilities, such as programming function keys. For all other
functionality, _cccc_uuuu_rrrr_ssss_eeee_ssss routines are more suitable and their use is
recommended.
Initially, _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm should be called. Note that _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm is
automatically called by _iiii_nnnn_iiii_tttt_ssss_cccc_rrrr and _nnnn_eeee_wwww_tttt_eeee_rrrr_mmmm. This defines the set of
terminal-dependent variables [listed in _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo(4)]. The _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo
variables _llll_iiii_nnnn_eeee_ssss and _cccc_oooo_llll_uuuu_mmmm_nnnn_ssss are initialized by _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm as follows: If
_uuuu_ssss_eeee______eeee_nnnn_vvvv_((((_FFFF_AAAA_LLLL_SSSS_EEEE_)))) has been called, values for _llll_iiii_nnnn_eeee_ssss and _cccc_oooo_llll_uuuu_mmmm_nnnn_ssss specified in
_tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo are used. Otherwise, if the environment variables _LLLL_IIII_NNNN_EEEE_SSSS and
_CCCC_OOOO_LLLL_UUUU_MMMM_NNNN_SSSS exist, their values are used. If these environment variables do
not exist and the program is running in a window, the current window size
is used. Otherwise, if the environment variables do not exist, the
values for _llll_iiii_nnnn_eeee_ssss and _cccc_oooo_llll_uuuu_mmmm_nnnn_ssss specified in the _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo database are used.
The header files _cccc_uuuu_rrrr_ssss_eeee_ssss_...._hhhh and _tttt_eeee_rrrr_mmmm_...._hhhh should be included (in this order)
to get the definitions for these strings, numbers, and flags.
Parameterized strings should be passed through _tttt_pppp_aaaa_rrrr_mmmm to instantiate them.
All _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo strings [including the output of _tttt_pppp_aaaa_rrrr_mmmm] should be printed
with _tttt_pppp_uuuu_tttt_ssss or _pppp_uuuu_tttt_pppp. Call the _rrrr_eeee_ssss_eeee_tttt______ssss_hhhh_eeee_llll_llll______mmmm_oooo_dddd_eeee to restore the tty modes
before exiting [see _cccc_uuuu_rrrr_ssss______kkkk_eeee_rrrr_nnnn_eeee_llll(3X)]. Programs which use cursor
addressing should output _eeee_nnnn_tttt_eeee_rrrr______cccc_aaaa______mmmm_oooo_dddd_eeee upon startup and should output
_eeee_xxxx_iiii_tttt______cccc_aaaa______mmmm_oooo_dddd_eeee before exiting. Programs desiring shell escapes should call
_rrrr_eeee_ssss_eeee_tttt______ssss_hhhh_eeee_llll_llll______mmmm_oooo_dddd_eeee and output _eeee_xxxx_iiii_tttt______cccc_aaaa______mmmm_oooo_dddd_eeee before the shell is called and
should output _eeee_nnnn_tttt_eeee_rrrr______cccc_aaaa______mmmm_oooo_dddd_eeee and call _rrrr_eeee_ssss_eeee_tttt______pppp_rrrr_oooo_gggg______mmmm_oooo_dddd_eeee after returning from
the shell.
The _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm routine reads in the _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo database, initializing the
_tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo structures, but does not set up the output virtualization
structures used by _cccc_uuuu_rrrr_ssss_eeee_ssss. The terminal type is the character string
_t_e_r_m; if _t_e_r_m is null, the environment variable _TTTT_EEEE_RRRR_MMMM is used. All output
is to file descriptor _ffff_iiii_llll_dddd_eeee_ssss which is initialized for output. If _e_r_r_r_e_t
is not null, then _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm returns _OOOO_KKKK or _EEEE_RRRR_RRRR and stores a status value
in the integer pointed to by _e_r_r_r_e_t. A status of _1111 in _e_r_r_r_e_t is normal,
_0000 means that the terminal could not be found, and _----_1111 means that the
_tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo database could not be found. If _e_r_r_r_e_t is null, _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm
prints an error message upon finding an error and exits. Thus, the
provides the same functionality as _ssss_eeee_tttt_tttt_eeee_rrrr_mmmm_((((_t_e_r_m_)))). The _ssss_eeee_tttt_tttt_eeee_rrrr_mmmm routine is
included here for compatibility and is supported at Level 2.
The _ssss_eeee_tttt______cccc_uuuu_rrrr_tttt_eeee_rrrr_mmmm routine sets the variable _cccc_uuuu_rrrr______tttt_eeee_rrrr_mmmm to _n_t_e_r_m, and makes
all of the _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo boolean, numeric, and string variables use the values
from _n_t_e_r_m.
The _dddd_eeee_llll______cccc_uuuu_rrrr_tttt_eeee_rrrr_mmmm routine frees the space pointed to by _o_t_e_r_m and makes it
available for further use. If _o_t_e_r_m is the same as _cccc_uuuu_rrrr______tttt_eeee_rrrr_mmmm, references
to any of the _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo boolean, numeric, and string variables thereafter
may refer to invalid memory locations until another _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm has been
called.
The _rrrr_eeee_ssss_tttt_aaaa_rrrr_tttt_tttt_eeee_rrrr_mmmm routine is similar to _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm and _iiii_nnnn_iiii_tttt_ssss_cccc_rrrr, except that
it is called after restoring memory to a previous state. It assumes that
the windows and the input and output options are the same as when memory
was saved, but the terminal type and baud rate may be different.
The _tttt_pppp_aaaa_rrrr_mmmm routine instantiates the string _s_t_r with parameters _p_i. A
pointer is returned to the result of _s_t_r with the parameters applied.
The _tttt_pppp_uuuu_tttt_ssss routine applies padding information to the string _s_t_r and
outputs it. The _s_t_r must be a terminfo string variable or the return
value from _tttt_pppp_aaaa_rrrr_mmmm, _tttt_gggg_eeee_tttt_ssss_tttt_rrrr, or _tttt_gggg_oooo_tttt_oooo. _a_f_f_c_n_t is the number of lines
affected, or 1 if not applicable. _p_u_t_c is a _pppp_uuuu_tttt_cccc_hhhh_aaaa_rrrr-like routine to
which the characters are passed, one at a time.
The _pppp_uuuu_tttt_pppp routine calls _tttt_pppp_uuuu_tttt_ssss_((((_s_t_r_,,,, _1111_,,,, _pppp_uuuu_tttt_cccc_hhhh_aaaa_rrrr_)))). Note that the output of
_pppp_uuuu_tttt_pppp always goes to _ssss_tttt_dddd_oooo_uuuu_tttt, not to the _f_i_l_d_e_s specified in _ssss_eeee_tttt_uuuu_pppp_tttt_eeee_rrrr_mmmm.
The _vvvv_iiii_dddd_pppp_uuuu_tttt_ssss routine displays the string on the terminal in the video
attribute mode _a_t_t_r_s, which is any combination of the attributes listed
in _cccc_uuuu_rrrr_ssss_eeee_ssss(3X). The characters are passed to the _pppp_uuuu_tttt_cccc_hhhh_aaaa_rrrr-like routine
_p_u_t_c.
The _vvvv_iiii_dddd_aaaa_tttt_tttt_rrrr routine is like the _vvvv_iiii_dddd_pppp_uuuu_tttt_ssss routine, except that it outputs
through _pppp_uuuu_tttt_cccc_hhhh_aaaa_rrrr.
The _mmmm_vvvv_cccc_uuuu_rrrr routine provides low-level cursor motion.
The _tttt_iiii_gggg_eeee_tttt_ffff_llll_aaaa_gggg, _tttt_iiii_gggg_eeee_tttt_nnnn_uuuu_mmmm and _tttt_iiii_gggg_eeee_tttt_ssss_tttt_rrrr routines return the value of the
capability corresponding to the _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo _c_a_p_n_a_m_e passed to them, such as
_xxxx_eeee_nnnn_llll.
With the _tttt_iiii_gggg_eeee_tttt_ffff_llll_aaaa_gggg routine, the value _----_1111 is returned if _c_a_p_n_a_m_e is not a
boolean capability.
With the _tttt_iiii_gggg_eeee_tttt_nnnn_uuuu_mmmm routine, the value _----_2222 is returned if _c_a_p_n_a_m_e is not a
numeric capability.
With the _tttt_iiii_gggg_eeee_tttt_ssss_tttt_rrrr routine, the value _((((_cccc_hhhh_aaaa_rrrr _****_))))_----_1111 is returned if _c_a_p_n_a_m_e is
not a string capability.
The _c_a_p_n_a_m_e for each capability is given in the table column entitled
_c_a_p_n_a_m_e code in the capabilities section of _tttt_eeee_rrrr_mmmm_iiii_nnnn_ffff_oooo(4).